using System;
using System.ComponentModel;

using BizElements.BusinessLayer;

namespace BizElements.Web
{
    /// <summary>Represents the method that will handle cancelable command event.</summary>
    /// <param name="sender">The source of the event. </param>
    /// <param name="e">Event data.</param>
    public delegate void CancelCommandEventHandler(object sender, CancelCommandEventArgs e);

    /// <summary>Provides data for a cancelable command event.</summary>
    public class CancelCommandEventArgs : CancelEventArgs
    {
        /// <summary>Initializes a new instance of <b>CancelCommandEventArgs</b> class.</summary>
        /// <param name="commandName">Command name.</param>
        /// <param name="commandArgument">Command argument.</param>
        public CancelCommandEventArgs(string commandName, object commandArgument)
        {
            this.CommandName = commandName;
            this.CommandArgument = commandArgument;            
        }

        /// <summary>Gets the name of the command.</summary>
        public string CommandName { get; private set; }

        /// <summary>Gets the argument for the command</summary>
        public object CommandArgument { get; private set; }
    }
}